"0","samwell_site <- get_site(sitename=""Samwell Cave"") #there's one site in the database that matches this"
"1","The API call was successful, you have returned "
"1"," "
"1","1"
"1"," "
"1","records.
"
"0","samwell_datasets <- get_dataset(samwell_site[[1]]) # this search lists all datasets associated with Samwell Cave. There are 7 different datasets for the site: 4 containing vertebrate faunal information and 3 containing geochronologic information. "
"2","The API call was successful, you have returned 7 records.

"
"0","browse(samwell_datasets)"
"1","NULL
"
"0","# Download info for just the last dataset, 14262. "
"0","scpd_dataset <- get_dataset(samwell_site[[1]])$'14262'"
"2","The API call was successful, you have returned 7 records.

"
"0","scpd_download <- get_download(scpd_dataset)"
"2","API call was successful. Returned record for Samwell Cave
"
"0","# Extract the count data and the sample ages"
"0","scpdFauna <- counts(scpd_download)[[1]]"
"0","scpdAges <- ages(scpd_download)[[1]]"
"0","   "
"0","# save as R object for later upload in case no internet or API not working"
"0","# save(scpdFauna, scpdAges, file=""data/scpdObjects.RData"")"
"0","# Note: Dataset 14261 contains the underlying radiocarbon dates for the site, in case you want to examine those. You'll need to uncomment the next two lines"
"0","# scpd_geochron <- get_geochron(14261)"
"0","# scpd_geochron[[1]]$geochron"
